package usbcali.edu.persistencia.dto;

import usbcali.edu.persistencia.SolicitAlimAstExter;

import usbcali.edu.presentation.backEndBeans.SolicitAlimAstExterView;

import java.io.Serializable;

import java.util.Date;

import javax.faces.event.ActionEvent;


/**
*
*
* @author Zathura Code Generator http://code.google.com/p/zathura
*
*/
public class SolicitAlimAstExterDTO implements Serializable {
    private static final long serialVersionUID = 1L;
    private String cargo;
    private String empresa;
    private String exNombre;
    private String codSolicitude_SolEventos;
    private String codSolExt;
    private boolean rowSelected = false;
    private SolicitAlimAstExterView solicitAlimAstExterView;
    private SolicitAlimAstExter solicitAlimAstExter;

    public SolicitAlimAstExter getSolicitAlimAstExter() {
        return solicitAlimAstExter;
    }

    public String listener_update(ActionEvent e) {
        try {
            solicitAlimAstExterView.action_modifyWitDTO(((cargo == null) ||
                cargo.equals("")) ? null : new String(cargo),
                ((codSolExt == null) || codSolExt.equals("")) ? null
                                                              : new String(
                    codSolExt),
                ((empresa == null) || empresa.equals("")) ? null
                                                          : new String(empresa),
                ((exNombre == null) || exNombre.equals("")) ? null
                                                            : new String(
                    exNombre),
                ((codSolicitude_SolEventos == null) ||
                codSolicitude_SolEventos.equals("")) ? null
                                                     : new String(
                    codSolicitude_SolEventos));
            rowSelected = !rowSelected;
        } catch (Exception ex) {
            return "";
        }

        return "";
    }

    public void listener_cancel(ActionEvent e) {
        codSolExt = solicitAlimAstExter.getCodSolExt().toString();
        cargo = (solicitAlimAstExter.getCargo() != null)
            ? solicitAlimAstExter.getCargo().toString() : null;
        empresa = (solicitAlimAstExter.getEmpresa() != null)
            ? solicitAlimAstExter.getEmpresa().toString() : null;
        exNombre = (solicitAlimAstExter.getExNombre() != null)
            ? solicitAlimAstExter.getExNombre().toString() : null;
        codSolicitude_SolEventos = (solicitAlimAstExter.getSolEventos()
                                                       .getCodSolicitude() != null)
            ? solicitAlimAstExter.getSolEventos().getCodSolicitude().toString()
            : null;
        rowSelected = !rowSelected;
    }

    /**
    * <p>Bound to commandLink actionListener in the ui that renders/unrenders
        * the Customer details for editing.</p>
        */
    public void toggleSelected(ActionEvent e) {
        codSolExt = solicitAlimAstExter.getCodSolExt().toString();
        cargo = (solicitAlimAstExter.getCargo() != null)
            ? solicitAlimAstExter.getCargo().toString() : null;
        empresa = (solicitAlimAstExter.getEmpresa() != null)
            ? solicitAlimAstExter.getEmpresa().toString() : null;
        exNombre = (solicitAlimAstExter.getExNombre() != null)
            ? solicitAlimAstExter.getExNombre().toString() : null;
        codSolicitude_SolEventos = (solicitAlimAstExter.getSolEventos()
                                                       .getCodSolicitude() != null)
            ? solicitAlimAstExter.getSolEventos().getCodSolicitude().toString()
            : null;
        rowSelected = !rowSelected;
    }

    public void setSolicitAlimAstExter(SolicitAlimAstExter solicitAlimAstExter) {
        this.solicitAlimAstExter = solicitAlimAstExter;
    }

    public SolicitAlimAstExterView getSolicitAlimAstExterView() {
        return solicitAlimAstExterView;
    }

    public void setSolicitAlimAstExterView(
        SolicitAlimAstExterView solicitAlimAstExterView) {
        this.solicitAlimAstExterView = solicitAlimAstExterView;
    }

    public String getCargo() {
        return cargo;
    }

    public void setCargo(String cargo) {
        this.cargo = cargo;
    }

    public String getEmpresa() {
        return empresa;
    }

    public void setEmpresa(String empresa) {
        this.empresa = empresa;
    }

    public String getExNombre() {
        return exNombre;
    }

    public void setExNombre(String exNombre) {
        this.exNombre = exNombre;
    }

    public String getCodSolicitude_SolEventos() {
        return codSolicitude_SolEventos;
    }

    public void setCodSolicitude_SolEventos(String codSolicitude_SolEventos) {
        this.codSolicitude_SolEventos = codSolicitude_SolEventos;
    }

    public String getCodSolExt() {
        return codSolExt;
    }

    public void setCodSolExt(String codSolExt) {
        this.codSolExt = codSolExt;
    }

    public boolean isRowSelected() {
        return rowSelected;
    }

    public void setRowSelected(boolean rowSelected) {
        this.rowSelected = rowSelected;
    }
}
